﻿using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace FruitWeigher
{
	public partial class HighestScore : UserControl
	{
		public HighestScore()
		{
			// Required to initialize variables
			InitializeComponent();
            GSystem.HighestScore = this;
            Btn_Back.Click += new RoutedEventHandler(Btn_Back_Click);
            Ani_Hide.Completed += new EventHandler(Ani_Hide_Completed);
            ItemInfo item1,item2;
            item1.Heft = 10;
            item1.Type = 4;
            item2.Heft = 5;
            item2.Type = 1;
            WeigherShow.CreateItemShow(item1, null, item2, null);
		}

        void Ani_Hide_Completed(object sender, EventArgs e)
        {
            this.Visibility = System.Windows.Visibility.Collapsed;
        }

        void Btn_Back_Click(object sender, RoutedEventArgs e)
        {
            Close();
        }
        public void Show()
        {
            this.Visibility = System.Windows.Visibility.Visible;
            HighestScore1.Text = GSystem.GetHighestScore().ToString() ;
            Ani_SHow.Begin();
        }
        public void Close()
        {
            Ani_Hide.Begin();
        }
	}
}